using UnityEngine;
using UnityEngine.UI;

public class BottomFloorSizeController : MonoBehaviour
{
	[SerializeField]
	private RectTransform _bottomTile;

	private const float LeftMargin = 0.04347826f;

	private const float TopMargin = 34f / 207f;

	private const float RightMargin = 0.02173913f;

	public void PositionBottomTile(CanvasScaler canvasScaler, RectTransform viewPort, RectTransform cellAnchor, RectTransform content)
	{
		Rect rect = viewPort.rect;
		Vector2 referenceResolution = canvasScaler.referenceResolution;
		float num = referenceResolution.x * rect.width / rect.height * referenceResolution.y / referenceResolution.x;
		float num2 = cellAnchor.rect.width + 0.04347826f * num;
		num2 = num2 + 138.19f - num2 % 138.19f;
		_bottomTile.anchorMin = new Vector2(0f, 0f);
		_bottomTile.anchorMax = new Vector2(0f, 34f / 207f);
		_bottomTile.offsetMin = new Vector2(0f, 0f);
		_bottomTile.offsetMax = new Vector2(num2, 0f);
		_bottomTile.anchoredPosition = new Vector2(0.04347826f * num, 0f);
	}
}
